package com.app.ytong.other;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Gallery.LayoutParams;
import android.widget.ImageView;

import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;

import com.app.ytong.R;
import com.app.ytong.basis.BasisApp;
import com.flyco.dialog.widget.NormalDialog;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import my.LogUtil;
import photoview.PhotoView;
import photoview.PhotoViewAttacher;


/**
 * @作者 fourfaith
 * @备注 新闻详情图片查看activity发、
 */
public class PhotoDialog extends NormalDialog {

	@BindView(R.id.photo)
	ImageView photo;

	Bitmap bitmap;

	public static void toImgScanDialog(Activity context, Bitmap bitmap) {
		PhotoDialog dialog = new PhotoDialog(context,bitmap);
		dialog.show();
	}

	public PhotoDialog(Activity context,Bitmap bitmap) {
		super(context);
		mContext = context;
		this.bitmap = bitmap;
	}


	@Override
	public View onCreateView() {
//        return super.onCreateView();
		View inflate = LayoutInflater.from(mContext).inflate(R.layout.photo_dialog, null);
		ButterKnife.bind(this, inflate);

		widthScale(1.0f);
		return inflate;
	}

	@Override
	public void setUiBeforShow() {
		photo.setImageBitmap(bitmap);
		photo.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
	}


}
